home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!tektronix!tekgen!tekred!games
- From: games@tekred.TEK.COM
- Newsgroups: comp.sources.games
- Subject: v05i085: dungeon - game of adventure, SysVR3 patches
- Message-ID: <3253@tekred.TEK.COM>
- Date: 8 Nov 88 17:30:55 GMT
- Sender: billr@tekred.TEK.COM
- Lines: 986
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted by: Roger Noe <rjnoe@arrakis.ece.uiuc.edu>
- Comp.sources.games: Volume 5, Issue 85
- Archive-name: dungeon/SysVR3pch
-
- [Here is a set a patches supplied by Roger Noe, to make the Unix
- f77 version of dungeon compile and run under System V Rel 3.0.
- Not having this OS, I am not able to try them out so you are on your
- own. -br]
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: SysVR3.pch
- # Wrapped by billr@saab on Tue Nov 8 09:26:35 1988
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'SysVR3.pch' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'SysVR3.pch'\"
- else
- echo shar: Extracting \"'SysVR3.pch'\" \(26146 characters\)
- sed "s/^X//" >'SysVR3.pch' <<'END_OF_FILE'
- X*** README.rjnoe.orig Fri Oct 28 11:36:38 1988
- X--- README.rjnoe Fri Oct 28 11:36:38 1988
- X***************
- X*** 0
- X
- X--- 1,144 -----
- X+ I have attempted porting the UNIX F77 version of Dungeon - which you posted
- X+ to Usenet about a year ago - to the AT&T 3B2/400 running UNIX System V
- X+ Release 3.0. What follows is a description of some of the things I needed
- X+ to change just to get it running on my system. I hope you find it useful.
- X+ The base patch level I worked from was 3 (including the "3.1" patch).
- X+
- X+ 1. Different F77 Compilation System
- X+ First off, this UNIX system does not use the FORTRAN 77 compiler and
- X+ archive libraries used on previous versions of System V. What I have is
- X+ called FORTRAN 77 XLA+ Compilation System, Issue 1 Version 0. The F77
- X+ used on previous UNIX machines is sometimes called f77 1.1. This difference
- X+ required several changes to Makefile.sysv. Both the command to invoke
- X+ the compiler and options recognized by the compiler are different.
- X+ I have learned that there is a newer version of F77-XLA+ available from
- X+ AT&T; some of the problems I mention below might be fixed in that version.
- X+
- X+ 2. No LOGICAL Arguments to Bitwise Intrinsic Functions
- X+ The F77-XLA+ compiler is picky about LOGICAL type arguments being passed
- X+ to the intrinsic bitwise (INTEGER) functions and(), or(), and not(). This
- X+ was very easily fixed by translating to the logical operators .AND., .OR.,
- X+ and .NOT..
- X+
- X+ 3. No INTEGER Arguments to ichar() Intrinsic Function
- X+ The F77-XLA+ compiler is picky about INTEGER arguments passed to ichar().
- X+ They were redundant calls in all cases I found. (Just the INW() and UINW()
- X+ arrays were involved.)
- X+
- X+ 4. No $ Edit Descriptor in FORMAT Statements
- X+ The F77-XLA+ compiler does not recognize the $ in FORMAT statements as a
- X+ means of suppressing newline at the end of an output operation. This was
- X+ apparently not an oversight; they documented its absence. I have found some
- X+ vestiges of the code which would have implemented it (e.g. an external symbol
- X+ in the I/O library called "F77nonl") but the capability is just not there.
- X+ I can find no substitute and have been putting up with having my ">" game
- X+ prompt not appear on the same line as my input.
- X+
- X+ 5. FUNCTION INIT() Name Conflict
- X+ The external symbol "init" is used in the F77-XLA+ I/O library libfortI77.a
- X+ to indicate whether or not it has been initialized in the current process.
- X+ I merely changed the Dungeon function name to DINIT.
- X+
- X+ 6. CLOSE() with Long Filename Causes Fatal Run-time Errors
- X+ There is a bug in the F77-XLA+ I/O library libfortI77.a that occurs when
- X+ trying to CLOSE() a unit that had been OPENed to a UNIX file with a long
- X+ pathname. Think of the F77 I/O subsystem as overlying the standard I/O
- X+ (stdio) subsystem. A F77 OPEN eventually calls fopen(3S) [3S: in the stdio
- X+ library] and stores the FILE * pointer which fopen returns into an element
- X+ of an array of structures corresponding to the unit number OPENed. When
- X+ the unit is CLOSEd, the file name passed to OPEN is copied into a character
- X+ array within this same structure, using strcpy(3C) [3C: in the C library].
- X+ (I assume this is to allow future reOPENing of the file, but haven't really
- X+ looked into this much.) No bounds or string length checking is done. So
- X+ when the filename is long (as might be expected for INDXFILE or TEXTFILE),
- X+ this overwrites the next F77 I/O unit structure with garbage. If the next
- X+ unit was being used, the pointer to the corresponding stdio structure is now
- X+ gone. If not, the next unit now appears to be in use because the FILE *
- X+ is no longer a NULL pointer and when the F77 code exits normally (e.g.
- X+ through STOP) it will try to clean up this unit. These considerations
- X+ led me to make the following changes:
- X+
- X+ Since INDXFILE and TEXTFILE could not be CLOSEd once OPENed, I
- X+ moved INDXFILE from unit 1 to unit 3. Unit 1 is now used only
- X+ for "dsave.dat", which is short enough that it can be closed and
- X+ opened normally. TEXTFILE remains at unit 2.
- X+
- X+ I dropped my exit.F source file containing SUBROUTINE EXIT (which
- X+ consisted entirely of one executable statement, STOP) and replaced
- X+ it with exit.c containing the C function void exit_(). Since STOP
- X+ tries to clean up F77 I/O unit structures that have been OPENed,
- X+ I circumvent this by doing a CALL EXIT in F77 which invokes the
- X+ C function exit_() on my system. The latter function simply calls
- X+ exit() in the C/stdio library, cleans up the stdio structures and
- X+ terminates the process without mucking with the screwy F77 I/O
- X+ subsystem.
- X+
- X+ 7. CHARACTER Arguments Passed Inconsistently
- X+ The F77-XLA+ documentation indicates that a CHARACTER variable (or an
- X+ array of CHARACTER variables) is not quite passed by reference. Instead
- X+ of just passing the address of the variable (or base address of the array),
- X+ effectively what is passed is a pointer to a structure containing (in C):
- X+ struct { char *s; long l; } where s is the pointer to the CHARACTER variable
- X+ (or array) and l is its length. So dereferencing the passed pointer once
- X+ will give you s, the address of the CHARACTER variable. All fine and dandy,
- X+ but they DIDN'T TELL THE PEOPLE WHO CODED THE I/O LIBRARY! When a CHARACTER
- X+ array is passed to READ(), it interprets the structure pointer passed as the
- X+ address of the variable and starts overwriting the wrong place. The one place
- X+ I found this was in RDLINE() and I fixed it by changing the READ() BUFFER to
- X+ use an implied DO loop. What can I say, at least it works.
- X+
- X+ 8. Large Amounts of I/O in One Statement Fail
- X+ There appears to be some not easily identifiable bug in the F77-XLA+ I/O
- X+ library which causes it to abort when writing large amounts of data in
- X+ one single WRITE(). I found this when attempting to save the game in
- X+ dsave.dat. I separated the largest arrays (notably the COMMON /OBJCTS/
- X+ arrays) into individual WRITEs and haven't had any further problems.
- X+ I changed the READs (for game restoration) to be identical, just for
- X+ consistency's sake.
- X+
- X+
- X+ There are probably other bugs I have not yet discovered. Already I am
- X+ suspicious of the random number generation on my system since I've never
- X+ had to take more than one whack at the troll before he's knocked out.
- X+ I'll keep looking at things like that and keep you posted, if you like.
- X+
- X+
- X+ There are also a few other things my compiler complains about that I did not
- X+ bother to fix:
- X+
- X+ The C preprocessor (/lib/cpp) in System V Release 3 warns about extra
- X+ tokens on cpp lines like #else, #elif, and #endif. One way to suppress
- X+ these warnings is to add /* comment */ delimiters around the offending token:
- X+ #ifdef PDP
- X+ ...
- X+ #else /* PDP */
- X+ ...
- X+ #endif /* PDP */
- X+
- X+ The F77-XLA+ compiler warns about a duplicate type statement for PRSWON in
- X+ FUNCTION BLOW in demons.F. Since PRSWON is already declared in parser.h, it
- X+ need not be declared again in demons.F, as it #includes parser.h.
- X+
- X+ The F77-XLA+ compiler complains if the last statement before END in each
- X+ FUNCTION is not a RETURN. Specifically, in the following:
- X+ BALLOP in ballop.F
- X+ DINIT in dinit.F
- X+ LEX in np.F
- X+ SPARSE in np1.F
- X+ CYCLOP in villns.F
- X+ DINIT has FORMAT statements between RETURN and END, CYCLOP has a computed
- X+ GOTO just before the END, and the others all have unconditional GOTOs just
- X+ before their ENDs. If you ask me, the F77-XLA+ compiler is being a little
- X+ weird here.
- X+
- X+ If there's anything I can do to help out with Dungeon, please let me know.
- X+ If no one else has done it, I'm toying with the idea of porting it to C.
- X+ Please let me know your opinion on that. Thanks.
- X+ --
- X+ Roger Noe rjnoe@arrakis.ece.uiuc.edu
- X+ University of Illinois
- X+ Department of Electrical and Computer Engineering
- X+ 248 Everitt Laboratory
- X+ 1406 West Green Street
- X+ Urbana, IL 61801 USA 40:06:39 N. 88:13:41 W.
- X+ +1 217 333 3496
- X*** Makefile.sysv.orig Mon Oct 24 15:28:55 1988
- X--- Makefile.sysv Mon Oct 24 15:28:54 1988
- X***************
- X*** 1,3
- X # Makefile for creating dungeon
- X # Edit BIN DDIR and FFLAGS suitable for your system
- X # Also, if you are running System V change the .F.o production
- X
- X--- 1,4 -----
- X+ F77 = fort
- X # Makefile for creating dungeon
- X # Edit BIN DDIR and FFLAGS suitable for your system
- X # Also, if you are running System V change the .F.o production
- X***************
- X*** 11,17
- X # f77 -c $(FFLAGS) $*.F
- X # For System V use the following production instead:
- X @/lib/cpp $(CPPFLAGS) $*.F > $*.f
- X! f77 -c $(FFLAGS) $*.f
- X rm $*.f
- X
- X # define SYSV if running System V or V7
- X
- X--- 12,18 -----
- X # f77 -c $(FFLAGS) $*.F
- X # For System V use the following production instead:
- X @/lib/cpp $(CPPFLAGS) $*.F > $*.f
- X! $(F77) -c $(FFLAGS) $*.f
- X rm $*.f
- X
- X # define SYSV if running System V or V7
- X***************
- X*** 24,30
- X #FOPTS = -q # -g -Ddebug
- X # use -Nn650 for System V to increase default symbol table size
- X # also, no -g flag (causes runtime errors)
- X! FOPTS = -q -Nn650
- X # f77 compiler flags for pdp (64K split I/D)
- X #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
- X FFLAGS = -O $(FOPTS)
- X
- X--- 25,32 -----
- X #FOPTS = -q # -g -Ddebug
- X # use -Nn650 for System V to increase default symbol table size
- X # also, no -g flag (causes runtime errors)
- X! #FOPTS = -q -Nn650
- X! FOPTS =
- X # f77 compiler flags for pdp (64K split I/D)
- X #FOPTS = -q -I2 -L1 -i -DPDP # -Ddebug
- X FFLAGS = -O $(FOPTS)
- X***************
- X*** 51,57
- X FSRC = actors.F ballop.F clockr.F demons.F\
- X dgame.F dinit.F dmain.F dso1.F dso2.F\
- X dso3.F dso4.F dso5.F dso6.F dso7.F\
- X! dsub.F dverb1.F dverb2.F exit.F gdt.F lightp.F\
- X nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
- X rooms.F sobjs.F sverbs.F verbs.F villns.F
- X
- X
- X--- 53,59 -----
- X FSRC = actors.F ballop.F clockr.F demons.F\
- X dgame.F dinit.F dmain.F dso1.F dso2.F\
- X dso3.F dso4.F dso5.F dso6.F dso7.F\
- X! dsub.F dverb1.F dverb2.F gdt.F lightp.F\
- X nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
- X rooms.F sobjs.F sverbs.F verbs.F villns.F
- X
- X***************
- X*** 55,61
- X nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
- X rooms.F sobjs.F sverbs.F verbs.F villns.F
- X
- X! CSRC = cinit.c cio.c cspeak.c decode.c lex.c listen.c rtim.c
- X
- X OBJS = actors.o ballop.o clockr.o demons.o\
- X dgame.o dinit.o dmain.o dso1.o dso2.o\
- X
- X--- 57,63 -----
- X nobjs.F np.F np1.F np2.F np3.F nrooms.F objcts.F\
- X rooms.F sobjs.F sverbs.F verbs.F villns.F
- X
- X! CSRC = cinit.c cio.c cspeak.c decode.c exit.c lex.c listen.c rtim.c
- X
- X OBJS = actors.o ballop.o clockr.o demons.o\
- X dgame.o dinit.o dmain.o dso1.o dso2.o\
- X***************
- X*** 72,78
- X pdp: dungpdp speak listen dtext.dat
- X
- X dungeon: $(OBJS)
- X! f77 -o dungeon $(OBJS) $(LDFLAGS)
- X @echo done
- X
- X dungpdp: $(OBJS) $(PDPOBJS)
- X
- X--- 74,80 -----
- X pdp: dungpdp speak listen dtext.dat
- X
- X dungeon: $(OBJS)
- X! $(F77) -o dungeon $(OBJS) $(LDFLAGS)
- X @echo done
- X
- X dungpdp: $(OBJS) $(PDPOBJS)
- X***************
- X*** 98,105
- X dinit.o: dinit.F
- X # f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
- X # For System V use the following instead:
- X! @/lib/cpp $(CPPFLAGS) dinit.F > dinit.f
- X! f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.f
- X rm $*.f
- X
- X # uncomment the following for Suns to get around an optimizer bug
- X
- X--- 100,107 -----
- X dinit.o: dinit.F
- X # f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
- X # For System V use the following instead:
- X! @/lib/cpp $(CPPFLAGS) -DDDIR=$(DDIR) $(WIZDEF) dinit.F > dinit.f
- X! $(F77) -c $(FFLAGS) dinit.f
- X rm $*.f
- X
- X # uncomment the following for Suns to get around an optimizer bug
- X*** dinit.F.orig Mon Oct 24 15:28:55 1988
- X--- dinit.F Mon Oct 24 15:28:55 1988
- X***************
- X*** 18,24
- X C
- X C DECLARATIONS
- X C
- X! LOGICAL FUNCTION INIT(X)
- X IMPLICIT INTEGER (A-Z)
- X #ifndef PDP
- X LOGICAL PROTCT
- X
- X--- 18,24 -----
- X C
- X C DECLARATIONS
- X C
- X! LOGICAL FUNCTION DINIT(X)
- X IMPLICIT INTEGER (A-Z)
- X #ifndef PDP
- X LOGICAL PROTCT
- X***************
- X*** 153,159
- X FROMDR=0
- X SCOLRM=0
- X SCOLAC=0
- X! INIT=.FALSE.
- X MLOC=MRB
- X C
- X C INIT, PAGE 4
- X
- X--- 153,159 -----
- X FROMDR=0
- X SCOLRM=0
- X SCOLAC=0
- X! DINIT=.FALSE.
- X MLOC=MRB
- X C
- X C INIT, PAGE 4
- X***************
- X*** 247,253
- X HERE=AROOM(WINNER)
- X THFPOS=OROOM(THIEF)
- X BLOC=OROOM(BALLO)
- X! INIT=.TRUE.
- X #ifdef debug
- X C
- X C Normally, PRSFLG is setable in gdt to allow seeing various
- X
- X--- 247,253 -----
- X HERE=AROOM(WINNER)
- X THFPOS=OROOM(THIEF)
- X BLOC=OROOM(BALLO)
- X! DINIT=.TRUE.
- X #ifdef debug
- X C
- X C Normally, PRSFLG is setable in gdt to allow seeing various
- X***************
- X*** 266,272
- X 1925 continue
- X END
- X #else PDP
- X! 10000 INIT=.FALSE.
- X C !ASSUME INIT FAILS.
- X MMAX=1050
- X C !SET UP ARRAY LIMITS.
- X
- X--- 266,272 -----
- X 1925 continue
- X END
- X #else PDP
- X! 10000 DINIT=.FALSE.
- X C !ASSUME INIT FAILS.
- X MMAX=1050
- X C !SET UP ARRAY LIMITS.
- X***************
- X*** 449,455
- X C
- X C NOW RESTORE FROM EXISTING INDEX FILE.
- X C
- X! OPEN(UNIT=1,file=INDXFILE,status='OLD',
- X #ifdef XELOS
- X & FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
- X #else
- X
- X--- 449,455 -----
- X C
- X C NOW RESTORE FROM EXISTING INDEX FILE.
- X C
- X! OPEN(UNIT=3,file=INDXFILE,status='OLD',
- X #ifdef XELOS
- X & FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900,recl=1)
- X #else
- X***************
- X*** 455,462
- X #else
- X & FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
- X #endif
- X! rewind(unit=1, err=1900)
- X! READ(1,130) I,J,K
- X C !GET VERSION.
- X IF((I.NE.VMAJ).OR.(J.NE.VMIN))
- X & GO TO 1925
- X
- X--- 455,462 -----
- X #else
- X & FORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)
- X #endif
- X! rewind(unit=3, err=1900)
- X! READ(3,130) I,J,K
- X C !GET VERSION.
- X IF((I.NE.VMAJ).OR.(J.NE.VMIN))
- X & GO TO 1925
- X***************
- X*** 474,483
- X 150 FORMAT(' RESTORING FROM "dindx.dat"')
- X #endif NOCC
- X #endif debug
- X! READ(1,130) MXSCOR,STRBIT,EGMXSC
- X! READ(1,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
- X! READ(1,130) XLNT,TRAVEL
- X! READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
- X & OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
- X & OREAD
- X READ(1,130) R2LNT,OROOM2,RROOM2
- X
- X--- 474,483 -----
- X 150 FORMAT(' RESTORING FROM "dindx.dat"')
- X #endif NOCC
- X #endif debug
- X! READ(3,130) MXSCOR,STRBIT,EGMXSC
- X! READ(3,130) RLNT,RDESC2,RDESC1,REXIT,RACTIO,RVAL,RFLAG
- X! READ(3,130) XLNT,TRAVEL
- X! READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
- X & OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
- X & OREAD
- X READ(3,130) R2LNT,OROOM2,RROOM2
- X***************
- X*** 480,491
- X READ(1,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
- X & OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
- X & OREAD
- X! READ(1,130) R2LNT,OROOM2,RROOM2
- X! READ(1,130) CLNT,CTICK,CACTIO
- X! READ(1,135) CFLAG
- X! READ(1,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
- X! READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
- X! READ(1,130) MBASE,MLNT,RTEXT
- X C
- X CLOSE(1)
- X GO TO 1025
- X
- X--- 480,491 -----
- X READ(3,130) OLNT,ODESC1,ODESC2,ODESCO,OACTIO,OFLAG1,OFLAG2,
- X & OFVAL,OTVAL,OSIZE,OCAPAC,OROOM,OADV,OCAN,
- X & OREAD
- X! READ(3,130) R2LNT,OROOM2,RROOM2
- X! READ(3,130) CLNT,CTICK,CACTIO
- X! READ(3,135) CFLAG
- X! READ(3,130) VLNT,VILLNS,VPROB,VOPPS,VBEST,VMELEE
- X! READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
- X! READ(3,130) MBASE,MLNT,RTEXT
- X C
- X C don't CLOSE index file, even though it won't be used again
- X C
- X***************
- X*** 487,493
- X READ(1,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
- X READ(1,130) MBASE,MLNT,RTEXT
- X C
- X! CLOSE(1)
- X GO TO 1025
- X C !INIT DONE.
- X C
- X
- X--- 487,494 -----
- X READ(3,130) ALNT,AROOM,ASCORE,AVEHIC,AOBJ,AACTIO,ASTREN,AFLAG
- X READ(3,130) MBASE,MLNT,RTEXT
- X C
- X! C don't CLOSE index file, even though it won't be used again
- X! C
- X GO TO 1025
- X C !INIT DONE.
- X C
- X***************
- X*** 511,517
- X HERE=AROOM(WINNER)
- X THFPOS=OROOM(THIEF)
- X BLOC=OROOM(BALLO)
- X! INIT=.TRUE.
- X C
- X #ifdef debug
- X PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
- X
- X--- 512,518 -----
- X HERE=AROOM(WINNER)
- X THFPOS=OROOM(THIEF)
- X BLOC=OROOM(BALLO)
- X! DINIT=.TRUE.
- X C
- X #ifdef debug
- X PRINT 1050,RLNT,RMAX,XLNT,XMAX,OLNT,OMAX,MLNT,MMAX,
- X*** dmain.F.orig Mon Oct 24 15:28:56 1988
- X--- dmain.F Mon Oct 24 15:28:55 1988
- X***************
- X*** 9,15
- X C DECLARATIONS
- X C
- X IMPLICIT INTEGER (A-Z)
- X! LOGICAL INIT
- X #include "parser.h"
- X #include "gamestate.h"
- X #include "state.h"
- X
- X--- 9,15 -----
- X C DECLARATIONS
- X C
- X IMPLICIT INTEGER (A-Z)
- X! LOGICAL DINIT
- X #include "parser.h"
- X #include "gamestate.h"
- X #include "state.h"
- X***************
- X*** 193,199
- X C 1) INITIALIZE DATA STRUCTURES
- X C 2) PLAY GAME
- X C
- X! IF(INIT(X)) CALL GAME
- X C !IF INIT, PLAY GAME.
- X CALL EXIT
- X C !DONE
- X
- X--- 193,199 -----
- X C 1) INITIALIZE DATA STRUCTURES
- X C 2) PLAY GAME
- X C
- X! IF(DINIT(X)) CALL GAME
- X C !IF INIT, PLAY GAME.
- X CALL EXIT
- X C !DONE
- X*** dso3.F.orig Mon Oct 24 15:28:56 1988
- X--- dso3.F Mon Oct 24 15:28:56 1988
- X***************
- X*** 64,70
- X C OBJECT IS ON LIST... IS IT A MATCH?
- X C
- X IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
- X! IF(and(not(NOCARE),(and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
- X & ((and(OFLAG1(I),F1).EQ.0).AND.
- X & (and(OFLAG2(I),F2).EQ.0))) GO TO 500
- X IF(FWIM.EQ.0) GO TO 400
- X
- X--- 64,70 -----
- X C OBJECT IS ON LIST... IS IT A MATCH?
- X C
- X IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
- X! IF( ((.NOT. NOCARE) .AND. (and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
- X & ((and(OFLAG1(I),F1).EQ.0).AND.
- X & (and(OFLAG2(I),F2).EQ.0))) GO TO 500
- X IF(FWIM.EQ.0) GO TO 400
- X*** dso7.F.orig Mon Oct 24 15:28:56 1988
- X--- dso7.F Mon Oct 24 15:28:56 1988
- X***************
- X*** 23,29
- X C !UNBIAS, COMPUTE SUMS.
- X UKEYW(I)=char(ichar(KEYW(I))-64)
- X IF(INW(J).LE.char(64)) J=1
- X! UINW(I)=ichar(ichar(INW(J))-64)
- X UKEYWS=UKEYWS+ichar(UKEYW(I))
- X UINWS=UINWS+UINW(I)
- X J=J+1
- X
- X--- 23,29 -----
- X C !UNBIAS, COMPUTE SUMS.
- X UKEYW(I)=char(ichar(KEYW(I))-64)
- X IF(INW(J).LE.char(64)) J=1
- X! UINW(I)=ichar(INW(J))-64
- X UKEYWS=UKEYWS+ichar(UKEYW(I))
- X UINWS=UINWS+UINW(I)
- X J=J+1
- X***************
- X*** 32,38
- X USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
- X C !COMPUTE MASK.
- X DO 200 I=1,6
- X! J=and(xor(xor(ichar(UINW(I)),ichar(UKEYW(I))),USUM),31)
- X USUM=MOD(USUM+1,32)
- X IF(J.GT.26) J=MOD(J,26)
- X OUTW(I)=char(MAX0(1,J)+64)
- X
- X--- 32,38 -----
- X USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
- X C !COMPUTE MASK.
- X DO 200 I=1,6
- X! J=and(xor(xor(UINW(I),ichar(UKEYW(I))),USUM),31)
- X USUM=MOD(USUM+1,32)
- X IF(J.GT.26) J=MOD(J,26)
- X OUTW(I)=char(MAX0(1,J)+64)
- X*** dsub.F.orig Mon Oct 24 15:28:57 1988
- X--- dsub.F Mon Oct 24 15:28:56 1988
- X***************
- X*** 391,401
- X C !INVOLUNTARY EXIT.
- X 1100 CALL SCORE(.FALSE.)
- X C !TELL SCORE.
- X! #ifdef PDP
- X! C file closed in exit routine
- X! #else
- X! CLOSE(DBCH)
- X! #endif PDP
- X CALL EXIT
- X C
- X END
- X
- X--- 391,397 -----
- X C !INVOLUNTARY EXIT.
- X 1100 CALL SCORE(.FALSE.)
- X C !TELL SCORE.
- X! C don't close DBCH, just exit
- X CALL EXIT
- X C
- X END
- X*** dverb2.F.orig Mon Oct 24 15:28:57 1988
- X--- dverb2.F Mon Oct 24 15:28:57 1988
- X***************
- X*** 91,99
- X & SWDACT,SWDSTA,CPVEC
- X WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
- X & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
- X! WRITE(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
- X! & OSIZE,OCAPAC,OROOM,OADV,OCAN
- X! WRITE(1) RVAL,RFLAG
- X WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
- X WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
- X C
- X
- X--- 91,109 -----
- X & SWDACT,SWDSTA,CPVEC
- X WRITE(1) I,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
- X & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
- X! WRITE(1) ODESC1
- X! WRITE(1) ODESC2
- X! WRITE(1) OFLAG1
- X! WRITE(1) OFLAG2
- X! WRITE(1) OFVAL
- X! WRITE(1) OTVAL
- X! WRITE(1) OSIZE
- X! WRITE(1) OCAPAC
- X! WRITE(1) OROOM
- X! WRITE(1) OADV
- X! WRITE(1) OCAN
- X! WRITE(1) RVAL
- X! WRITE(1) RFLAG
- X WRITE(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
- X WRITE(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
- X C
- X***************
- X*** 195,201
- X rewind (unit=1, err=100)
- X C
- X READ(1) I,J,K
- X! IF(or((I.NE.VMAJ),(J.NE.VMIN))) GO TO 200
- X C
- X READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
- X & SWDACT,SWDSTA,CPVEC
- X
- X--- 205,211 -----
- X rewind (unit=1, err=100)
- X C
- X READ(1) I,J,K
- X! IF(((I.NE.VMAJ) .OR. (J.NE.VMIN))) GO TO 200
- X C
- X READ(1) WINNER,HERE,THFPOS,TELFLG,THFFLG,THFACT,
- X & SWDACT,SWDSTA,CPVEC
- X***************
- X*** 201,209
- X & SWDACT,SWDSTA,CPVEC
- X READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
- X & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
- X! READ(1) ODESC1,ODESC2,OFLAG1,OFLAG2,OFVAL,OTVAL,
- X! & OSIZE,OCAPAC,OROOM,OADV,OCAN
- X! READ(1) RVAL,RFLAG
- X READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
- X READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
- X C
- X
- X--- 211,229 -----
- X & SWDACT,SWDSTA,CPVEC
- X READ(1) PLTIME,MOVES,DEATHS,RWSCOR,EGSCOR,MXLOAD,
- X & LTSHFT,BLOC,MUNGRM,HS,FROMDR,SCOLRM,SCOLAC
- X! READ(1) ODESC1
- X! READ(1) ODESC2
- X! READ(1) OFLAG1
- X! READ(1) OFLAG2
- X! READ(1) OFVAL
- X! READ(1) OTVAL
- X! READ(1) OSIZE
- X! READ(1) OCAPAC
- X! READ(1) OROOM
- X! READ(1) OADV
- X! READ(1) OCAN
- X! READ(1) RVAL
- X! READ(1) RFLAG
- X READ(1) AROOM,ASCORE,AVEHIC,ASTREN,AFLAG
- X READ(1) FLAGS,SWITCH,VPROB,CFLAG,CTICK
- X C
- X***************
- X*** 421,427
- X C
- X C C7- FROBOZZ FLAG (BANK ALARM)
- X C
- X! 7000 FROBZF=and((OROOM(BILLS).NE.0),(OROOM(PORTR).NE.0))
- X RETURN
- X C CXAPPL, PAGE 3
- X C
- X
- X--- 441,447 -----
- X C
- X C C7- FROBOZZ FLAG (BANK ALARM)
- X C
- X! 7000 FROBZF=((OROOM(BILLS).NE.0) .AND. (OROOM(PORTR).NE.0))
- X RETURN
- X C CXAPPL, PAGE 3
- X C
- X*** exit.c.orig Mon Oct 24 15:28:57 1988
- X--- exit.c Mon Oct 24 15:28:57 1988
- X***************
- X*** 0
- X
- X--- 1 -----
- X+ void exit_() { exit(0); }
- X*** gdt.F.orig Mon Oct 24 15:28:58 1988
- X--- gdt.F Mon Oct 24 15:28:58 1988
- X***************
- X*** 102,108
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 200 FORMAT('GDT>',$)
- X #else NOCC
- X 200 FORMAT(' GDT>',$)
- X #endif NOCC
- X
- X--- 102,108 -----
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 200 FORMAT('GDT>')
- X #else NOCC
- X 200 FORMAT(' GDT>',$)
- X #endif NOCC
- X***************
- X*** 115,123
- X 230 FORMAT(2I6)
- X 240 FORMAT(I6)
- X #ifdef NOCC
- X! 225 FORMAT('Limits: ',$)
- X! 235 FORMAT('Entry: ',$)
- X! 245 FORMAT('Idx,Ary: ',$)
- X #else NOCC
- X 225 FORMAT(' Limits: ',$)
- X 235 FORMAT(' Entry: ',$)
- X
- X--- 115,123 -----
- X 230 FORMAT(2I6)
- X 240 FORMAT(I6)
- X #ifdef NOCC
- X! 225 FORMAT('Limits: ')
- X! 235 FORMAT('Entry: ')
- X! 245 FORMAT('Idx,Ary: ')
- X #else NOCC
- X 225 FORMAT(' Limits: ',$)
- X 235 FORMAT(' Entry: ',$)
- X***************
- X*** 344,350
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 480 FORMAT('Old=',L2,6X,'New= ',$)
- X #else NOCC
- X 480 FORMAT(' Old=',L2,6X,'New= ',$)
- X #endif NOCC
- X
- X--- 344,350 -----
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 480 FORMAT('Old=',L2,6X,'New= ')
- X #else NOCC
- X 480 FORMAT(' Old=',L2,6X,'New= ',$)
- X #endif NOCC
- X***************
- X*** 528,534
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 590 FORMAT('Old= ',I6,6X,'New= ',$)
- X #else NOCC
- X 590 FORMAT(' Old= ',I6,6X,'New= ',$)
- X #endif NOCC
- X
- X--- 528,534 -----
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 590 FORMAT('Old= ',I6,6X,'New= ')
- X #else NOCC
- X 590 FORMAT(' Old= ',I6,6X,'New= ',$)
- X #endif NOCC
- X***************
- X*** 574,580
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 610 FORMAT('Old= ',I6,6X,'New= ',$)
- X #else NOCC
- X 610 FORMAT(' Old= ',I6,6X,'New= ',$)
- X #endif NOCC
- X
- X--- 574,580 -----
- X GO TO 2000
- X C
- X #ifdef NOCC
- X! 610 FORMAT('Old= ',I6,6X,'New= ')
- X #else NOCC
- X 610 FORMAT(' Old= ',I6,6X,'New= ',$)
- X #endif NOCC
- X*** np.F.orig Mon Oct 24 15:28:58 1988
- X--- np.F Mon Oct 24 15:28:58 1988
- X***************
- X*** 25,31
- X 10 WRITE(OUTCH,50)
- X C !PROMPT FOR GAME.
- X #ifdef NOCC
- X! 50 FORMAT('>',$)
- X #else NOCC
- X 50 FORMAT(' >',$)
- X #endif NOCC
- X
- X--- 25,31 -----
- X 10 WRITE(OUTCH,50)
- X C !PROMPT FOR GAME.
- X #ifdef NOCC
- X! 50 FORMAT('>')
- X #else NOCC
- X 50 FORMAT(' >',$)
- X #endif NOCC
- X***************
- X*** 30,36
- X 50 FORMAT(' >',$)
- X #endif NOCC
- X
- X! 90 READ(INPCH,100, END=210) BUFFER
- X 100 FORMAT(78A1)
- X
- X DO 200 LENGTH=78,1,-1
- X
- X--- 30,36 -----
- X 50 FORMAT(' >',$)
- X #endif NOCC
- X
- X! 90 READ(INPCH,100,END=210) (BUFFER(LENGTH),LENGTH=1,78)
- X 100 FORMAT(78A1)
- X
- X DO 200 LENGTH=78,1,-1
- X***************
- X*** 38,44
- X 200 CONTINUE
- X GO TO 5
- X C !END OF FILE
- X! 210 STOP
- X C !TRY AGAIN.
- X
- X C
- X
- X--- 38,44 -----
- X 200 CONTINUE
- X GO TO 5
- X C !END OF FILE
- X! 210 CALL EXIT
- X C !TRY AGAIN.
- X
- X C
- X***************
- X*** 55,61
- X
- X C CONVERT TO UPPER CASE
- X 300 DO 400 I=1,LENGTH
- X! IF(and((BUFFER(I).GE.'a'),(BUFFER(I).LE.'z')))
- X & BUFFER(I)=char(ichar(BUFFER(I))-32)
- X 400 CONTINUE
- X #endif PDP
- X
- X--- 55,61 -----
- X
- X C CONVERT TO UPPER CASE
- X 300 DO 400 I=1,LENGTH
- X! IF(((BUFFER(I).GE.'a') .AND. (BUFFER(I).LE.'z')))
- X & BUFFER(I)=char(ichar(BUFFER(I))-32)
- X 400 CONTINUE
- X #endif PDP
- X***************
- X*** 105,111
- X C !ECHO MODE, FORCE FAIL.
- X IF(.NOT.SYNMCH(X)) GO TO 100
- X C !DO SYN MATCH.
- X! IF(and((PRSO.GT.0),(PRSO.LT.XMIN))) LASTIT=PRSO
- X C
- X C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
- X C
- X
- X--- 105,111 -----
- X C !ECHO MODE, FORCE FAIL.
- X IF(.NOT.SYNMCH(X)) GO TO 100
- X C !DO SYN MATCH.
- X! IF(((PRSO.GT.0) .AND. (PRSO.LT.XMIN))) LASTIT=PRSO
- X C
- X C SUCCESSFUL PARSE OR SUCCESSFUL VALIDATION
- X C
- X***************
- X*** 207,213
- X C !SPACE?
- X DO 500 I=1,9,3
- X C !SCH FOR CHAR.
- X! IF(and((J.GE.DLIMIT(I)),(J.LE.DLIMIT(I+1))))
- X & GO TO 4000
- X 500 CONTINUE
- X C
- X
- X--- 207,213 -----
- X C !SPACE?
- X DO 500 I=1,9,3
- X C !SCH FOR CHAR.
- X! IF(((J.GE.DLIMIT(I)) .AND. (J.LE.DLIMIT(I+1))))
- X & GO TO 4000
- X 500 CONTINUE
- X C
- X***************
- X*** 219,225
- X C
- X 1000 IF(PRSCON.GT.INLNT) PRSCON=1
- X C !FORCE PARSE RESTART.
- X! IF(and((CP.EQ.0),(OP.EQ.1))) RETURN
- X IF(CP.EQ.0) OP=OP-2
- X C !ANY LAST WORD?
- X LEX=.TRUE.
- X
- X--- 219,225 -----
- X C
- X 1000 IF(PRSCON.GT.INLNT) PRSCON=1
- X C !FORCE PARSE RESTART.
- X! IF(((CP.EQ.0) .AND. (OP.EQ.1))) RETURN
- X IF(CP.EQ.0) OP=OP-2
- X C !ANY LAST WORD?
- X LEX=.TRUE.
- X*** sverbs.F.orig Mon Oct 24 15:28:59 1988
- X--- sverbs.F Mon Oct 24 15:28:58 1988
- X***************
- X*** 293,303
- X C !TELLL SCORE.
- X IF(.NOT.YESNO(343,0,0)) RETURN
- X C !ASK FOR Y/N DECISION.
- X! #ifdef PDP
- X! C close routine moved to exit for pdp version
- X! #else
- X! CLOSE (DBCH)
- X! #endif PDP
- X CALL EXIT
- X C !BYE.
- X C SVERBS, PAGE 4
- X
- X--- 293,299 -----
- X C !TELLL SCORE.
- X IF(.NOT.YESNO(343,0,0)) RETURN
- X C !ASK FOR Y/N DECISION.
- X! C don't close DBCH, just exit
- X CALL EXIT
- X C !BYE.
- X C SVERBS, PAGE 4
- X
- X
- END_OF_FILE
- if test 26146 -ne `wc -c <'SysVR3.pch'`; then
- echo shar: \"'SysVR3.pch'\" unpacked with wrong size!
- fi
- # end of 'SysVR3.pch'
- fi
- echo shar: End of shell archive.
- exit 0
-